home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-assert.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  48 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                          GNAT RUNTIME COMPONENTS                         --
  4. --                                                                          --
  5. --                     S Y S T E M . A S S E R T I O N S                   --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This module contains the definition of the exception that is raised
  27. --  when an assertion made using pragma Assert fails (i.e. the given
  28. --  expression evaluates to False. It also contains the routines used
  29. --  to raise this assertion with an associated message.
  30.  
  31. with System.Dependent_Constants; use System.Dependent_Constants;
  32.  
  33. package System.Assertions is
  34.  
  35.    Assert_Msg : String (1 .. Exception_Msg_Max);
  36.    Assert_Msg_Length : Natural := 0;
  37.    --  Characters and length of message passed to Raise_Assert_Failure
  38.    --  The initial length of zero indicates that no message has been set
  39.    --  yet (and Assert_Message will return the null string in such cases)
  40.  
  41.    Assert_Failure : exception;
  42.    --  Exception raised when assertion fails
  43.  
  44.    procedure Raise_Assert_Failure (Msg : String);
  45.    --  Called to raise Assert_Failure with given message
  46.  
  47. end System.Assertions;
  48.